<!DOCTYPE html>
<html lang="zh-CN">

<head>
	<meta charset="UTF-8" />
	<meta name="author" content="wangbo" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<title>变量</title>
</head>

<body>
	<script>

		
		var fun = function () {
			
		}
  	// getVarInfo(111)
		// getVarInfo("111")
		// getVarInfo(fun)
		getVarInfo(a)






		

		function getVarInfo(params) {
			if (typeof params == "number") {
				alert("变量的类型是--》数字")
			}
			if (typeof params == "string") {
				alert("变量的类型是--》字符串")
			}
			if (typeof params == "function") {
				alert("变量的类型是--》函数")
			}
			console.log(typeof params)
			// if (typeof params == "undefined") {
			// 	alert("变量的类型是--》undefined没有定义")
			// }
		}
	</script>
</body>

</html>